In the context of magnetic disk drives used for storing computer data, the term fragmentation is used to refer to the non-contiguous arrangement of files on a disk partition or logical disk. Fragmented files can refer to parts of the same disk file scattered over different areas of the logical disk or to the scattering of whole files so that there is unused space between files. Fragmentation often occurs as old files are deleted from the logical disk and new files are added. As files are deleted and the previously used space becomes available, the computer's operating system writes new files into the vacant areas of the logical disk. However, if a new file is too large to fit in a vacant area, the operating system may fragment the file by storing portions of the file in several vacant areas, which may be scattered throughout the logical disk. Likewise, an existing file may become fragmented if its size increases beyond the size of the contiguous free space adjacent the space in which the file is stored. The operating system maintains a record of where each part of a file is stored so the file can be retrieved in the proper order when the file is read from the logical disk.
In situations where a file is read "linearly" from beginning to end, fragmentation slows disk access and degrades the overall performance of disk operations. Utility programs are available to defragment the files on fragmented disks. In addition to rearranging the files so that each file is stored in contiguous portions of the disk, these programs usually arrange the files so that they are all stored at the beginning of the logical disk. This consolidates vacant space at the end of the disk and is considered beneficial because the operating system need not search as long in order to locate sufficient available space in which to store new files, and the new files are more likely to be stored in contiguous clusters (i.e., unfragmented), rather than in numerous smaller groups of clusters scattered throughout the disk.
Defragmentation is advantageous and improves performance when the unfragmented files are read linearly from beginning to end. However, when some operations are performed, the computer retrieves blocks of data from several different files in some predictable sequence, while often reading only a few blocks from each file. For example, launching a word processing program may result in loading a first part of the main executable, a portion of a dynamic linked library, a second portion of the main executable, a preferences file, etc. Similar disk activity occurs when some program commands (e.g., "File Open") are selected. These types of disk-intensive operations can result in a lot of disk head movement from one physical cluster to another. Because modern microprocessors are so fast in comparison to a disk drive's average seek time and many different files must be read from the disk in order to launch a typical program, a large portion of the time required to launch a program is spent with the microprocessor sitting idle waiting for the disk heads to move from one cluster to another.
Based on these observations, it is advantageous, when performing a disk-intensive operation (e.g., launching a program or launching code associated with some commands) to arrange the data blocks used during the disk-intensive operation on the logical disk partition (and thus on the physical disk) in the order they are accessed during that operation. This would result in the program files being "fragmented" by design and would improve performance by reducing the number of non-sequential disk accesses needed to load the required data from the logical disk.
The prior art describes this type of restructuring or fragmenting of application files in order to optimize the application launch process. For example, IBM Technical Disclosure Bulletin Serial No. TDB0196.0112 describes what it calls profile guided file system restructuring. Instead of arranging files based on static assumptions about file reference patterns, the system dynamically determines file access patterns as programs are run and allocates disk space to maximize file system performance for each hardware/software configuration the program is run on. To accomplish this, file system activity is monitored while the program starts up and the accessed disk sectors are logged to a file that contains profile data. At predetermined intervals, the profile data is analyzed to determine if a more optimal file allocation structure is possible. If so, the operator can run a restructuring program that allocates disk space to files based upon the disk access patterns indicated in the profile data. The program would map the disk block access addresses from the profile data to their associated files and place the frequently accessed blocks physically close together on the disk. The resulting disk block allocation structure would be optimized for the common access patterns for that specific computer configuration.
Microsoft Corporation has also announced that its "WINDOWS 98" operating system will include features that allow it to monitor disk activity during application program launch and rearrange the stored files so that data blocks used during startup are arranged in sequential fashion.
Although the prior art describes a process for optimizing files for program startup, these techniques are performed after programs are installed on a computer and subsequently launched by a user. This approach includes several drawbacks. For example, optimization cannot take place until a program has been installed and launched and the startup process has been monitored. The process of monitoring disk accesses during program startup can slow the startup process significantly. After the startup process is monitored, the computer must run a time-consuming optimization routine, which will prevent the user from using the computer during the optimization process or require the user to leave the computer on so the routine can be run after hours. Finally, this approach is suited only for monitoring and optimizing the startup process, but not for other disk-intensive operations, such as loading the code associated with some commands (e.g., "File Open").
Where the optimization features are implemented in operating system software, a user would have to obtain and install a copy of the appropriate version of the operating system in order to avail himself of these optimization features. In many cases, users are reluctant to spend the money or time required to upgrade their operating system software in order to take advantage of new features, or may be in a corporation where they do not make this decision on their own. This results in a large number of users who use older versions of an operating system and are unable to experience improved performance at application startup.
Therefore, there is a need in the art for an improved system and method for storing data on a logical disk in the order in which it will be accessed when applications or commands are launched. Such a method should avoid the need to monitor application program files after they are installed on a logical disk and should not require users to acquire and install a new version of their operating system software.